#include <iostream>
using namespace std;

int main()
{
    int i,n;
    float x[15],f[15],h;
    cout<<"Enter the value of n :";
    cin>>n;
    cout<<"Enter the value of x and corresponding value for f(x)"<<endl;
    for(i=0;i<=n;i++)
    {
        cin>>x[i]>>f[i];
    }
    h=x[1]-x[0];
    float term,sum;
    term=f[0]+f[n];
    for(i=0;i<n-1;i++)
    {
        term+=2.0*f[i];
    }
    sum=term*h/2.0;
    cout<<"Interval="<<sum;
    cin.get();
}
